#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @FileName  :main.py
# @Time      :2021/6/20 19:09
# @Author    : 刘广鸿

"""
    The api of this project for help you can goto:
    http://127.0.0.1:8000/docs or http://127.0.0.1:8000/redoc

"""

import uvicorn
from config import config
from api import test, register, getDatas, updateDatas, login, weather_spider
from mqtt import mqttSub
import threading


def doMqtt():
    client = mqttSub.MQTTRecv(mqttSub.topicList)
    client.client.loop_forever()


threading.Thread(target=doMqtt).start()  # 开启定时任务

if __name__ == '__main__':
    uvicorn.run(app="config.config:shzx_app", host="127.0.0.1", port=8000, reload=True, debug=True)
